package com.jxs.easysecurity.token;

/**
 * 用于包内部使用，对外则提供{@link AccessToken}。
 * @author jiangxingshang
 * @since 17/6/21
 */
public class AccessTokenEx extends AccessToken {

    public AccessTokenEx() {

    }

    public AccessTokenEx(String token) {
        setToken(token);
    }

    public AccessTokenEx(String token, String sessionId, long timeout, String extra) {
        setToken(token);
        setSessionId(sessionId);
        setTimeout(timeout);
        setExtra(extra);
    }

    public void setToken(String token) {
        this.token = token;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public void setTimeout(long timeout) {
        this.timeout = timeout;
    }

    public void setExtra(String extra) {
        this.extra = extra;
    }

    public final AccessToken get() {
        AccessToken t = new AccessToken();
        t.token = token;
        t.timeout = timeout;
        t.sessionId = sessionId;
        t.extra = extra;
        return t;
    }
}
